package com.weixin.paleituo.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import java.util.List;

/**
 * Author yichao
 * Time  2018/1/11 15:11
 * Dest  横向滑动适配器基类
 */

public abstract class AbHorizontalScrollViewAdapter<T> {

    protected Context mContext;

    /**
     * 设置数据
     * @param TS
     */
    public void setTS(List<T> TS) {
        mTS = TS;
    }

    protected List<T> mTS;
    protected LayoutInflater mInflater;

    public AbHorizontalScrollViewAdapter(Context context, List<T> TS) {
        mContext = context;
        mTS = TS;
        mInflater = LayoutInflater.from(context);

    }
    public int getCount()
    {
        return mTS.size();
    }

    public Object getItem(int position)
    {
        return mTS.get(position);
    }

    public long getItemId(int position)
    {
        return position;
    }
    public abstract View getView(int position, View convertView, ViewGroup parent);


}
